home *** CD-ROM | disk | FTP | other *** search
/ Dr. Health'nstein's Body Fun / bodyfun.iso / mac / MAC MOVIE FOLDER / MAZE.DIR / 00499_Script_499 < prev   
Text File  |  1994-10-12  |  4KB  |  140 lines

  1. on StartMovie
  2.   StdStartMovie
  3.   
  4.   SetTextInfo "Portion", " ", "center", "helvetica", 18, "bold"
  5.   SetTextInfo "Answer", " ", "center", "helvetica", 12, "bold"
  6.   
  7.   repeat with i = 22 to 26 -- hide foods on bottom
  8.     set the visible of sprite i to FALSE
  9.   end repeat
  10.   
  11.   global MAZEPOINTS
  12.   set MAZEPOINTS = 0
  13. end StartMovie
  14.  
  15. on StopMovie
  16.   global gMealArray
  17.   put empty into gMealArray
  18. end
  19.  
  20. on BeforeHelp
  21. end
  22.  
  23. on AfterHelp
  24. end
  25.  
  26. on Choose direction
  27.   ShowTextAnswer
  28.   updateStage
  29.   
  30.   global CorrectFoodChoice, MazeNumRight, MazeNumWrong
  31.   if (direction = "Left" and CorrectFoodChoice = 1) or (direction = "Right" and CorrectFoodChoice = 2) then
  32.     StartSound "RIGHT.AIF"
  33.     set MazeNumRight = MazeNumRight + 1
  34.     set the visible of sprite (15+MazeNumRight) to FALSE    
  35.     set the fileName of cast ("Food " & MazeNumRight) to the fileName of cast ("Food " & direction)    
  36.     CenterRegPoint(cast ("Food " & MazeNumRight))
  37.     set the visible of sprite (21+MazeNumRight) to TRUE
  38.   else
  39.     StartSound "WRONG.AIF"
  40.     set MazeNumWrong = MazeNumWrong + 1
  41.   end if
  42.   updateStage
  43.   
  44.   set the visible of sprite 7 to FALSE
  45.   set the visible of sprite 8 to FALSE
  46.   set the visible of sprite 11 to FALSE
  47.   set the visible of sprite 10 to FALSE
  48.   
  49.   global MazeMoves, gMovieMedia, MAZEPOINTS
  50.   set the fileName of cast "MOVES" to (gMovieMedia & "NUM_" & (MazeMoves - MazeNumRight - MazeNumWrong) & ".PIC")
  51.   --CenterRegPoint(cast "MOVES")
  52.   
  53.   if (MazeNumRight = 5) then -- outa here
  54.     if MazeMoves = 5 then
  55.       set the fileName of cast "AWARD" to (gMovieMedia & "AWARD_1.PIC")
  56.       set MAZEPOINTS = 5
  57.     else if MazeMoves = 10 then
  58.       set the fileName of cast "AWARD" to (gMovieMedia & "AWARD_3.PIC")
  59.       set MAZEPOINTS = 1
  60.     else
  61.       set the fileName of cast "AWARD" to (gMovieMedia & "AWARD_2.PIC")
  62.       set MAZEPOINTS = 3
  63.     end if
  64.     --CenterRegPoint(cast "AWARD")
  65.     
  66.     go to frame ("EXIT " & direction)
  67.   else if (MazeNumRight + MazeNumWrong) = MazeMoves then -- oops, didn't get 5 right
  68.     set the fileName of cast "AWARD" to (gMovieMedia & "PUNISH.PIC")
  69.     set MAZEPOINTS = -3
  70.     go to frame "Surrender"
  71.   else
  72.     go to frame direction
  73.   end if
  74. end
  75.  
  76.  
  77. on DisplayTwoFoods
  78.   global gMediaFolder, gSep
  79.   put gMediaFolder & "FOOD" & gSep & "FOODS" & gSep into foodFolder
  80.   
  81.   global MazeCurMove, MazeStartAt
  82.   SetItemDelim(TAB)
  83.   
  84.   global gMealArray
  85.   put line (MazeStartAt + MazeCurMove) of gMealArray into theChoices
  86.   set MazeCurMove = MazeCurMove + 1
  87.   
  88.   put item 3 of theChoices into leftFood
  89.   put item 6 of theChoices into rightFood
  90.   global CorrectFoodChoice
  91.   put integer(item 2 of theChoices) into CorrectFoodChoice
  92.   
  93.   global Portion11, Portion12, Portion21, Portion22, TextAnswer
  94.   put item 4 of theChoices into Portion11
  95.   put item 5 of theChoices into Portion12
  96.   if char 1 of Portion12 = "X" then set Portion12 = ""
  97.   put item 7 of theChoices into Portion21
  98.   put item 8 of theChoices into Portion22
  99.   if char 1 of Portion22 = "X" then set Portion22 = ""
  100.   put item 9 of theChoices into TextAnswer
  101.   
  102.   set the fileName of cast "Food Left" to (foodFolder & leftFood)
  103.   BottomCenterRegPoint(cast "Food Left")
  104.   set the fileName of cast "Food Right" to (foodFolder & rightFood)
  105.   BottomCenterRegPoint(cast "Food Right")
  106.   updateStage
  107.   
  108.   set the visible of sprite 7 to TRUE
  109.   set the visible of sprite 8 to TRUE -- show Left Food
  110.   set the visible of sprite 11 to TRUE -- show Right Food
  111.   set the visible of sprite 10 to TRUE
  112.   RestoreItemDelim
  113. end DisplayTwoFoods
  114.  
  115. on ShowPortion
  116.   global Portion11, Portion12, Portion21, Portion22
  117.   put the mouseCast into theMouseCast
  118.   if theMouseCast > 0 then
  119.     if the name of cast theMouseCast = "Choose Left" then
  120.       if line 1 of field "Portion" <> Portion11 then 
  121.         put Portion11 into line 1 of field "Portion"
  122.         put Portion12 into line 2 of field "Portion"
  123.       end if
  124.     else if the name of cast theMouseCast = "Choose Right" then
  125.       if line 1 of field "Portion" <> Portion21 then 
  126.         put Portion21 into line 1 of field "Portion"
  127.         put Portion22 into line 2 of field "Portion"
  128.       end if
  129.     else if field "Portion" <> " " then
  130.       put " " into field "Portion"
  131.     end if
  132.   end if
  133. end
  134.  
  135. on ShowTextAnswer
  136.   global TextAnswer
  137.   put TextAnswer into field "Answer"
  138. end
  139.  
  140.